#ifndef FLAPPYBIRD_H
#define FLAPPYBIRD_H

#include <QMainWindow>
#include <QKeyEvent>
#include <QPushButton>
#include <QPainter>
#include <QTime>
#include <QPoint>
#include <QSize>
#include <QDebug>
#include <QMessageBox>
#include <QRect>

namespace Ui {
class flappybird;
}

class bird
{
public:
    double x=200;
    double y=400;
    double v=0.9;
    double g=-0.002;

};

class flappybird : public QMainWindow
{
    Q_OBJECT

public:
    explicit flappybird(QWidget *parent = 0);
    ~flappybird();
    void paintEvent(QPaintEvent *);
    void keyPressEvent(QKeyEvent *event);
    void display();
    void die();
    QPushButton *button;

    int time=0;
    bird F;
    int diecount=0;
    int count=0;
    int h;
    bool state=1;
    QTime time1;

    double l1=1200;
    double l2=1600;
    double l3=2000;
    double l4=2400;

    QRect r1=QRect(l1,0,60,800);
    QRect r2=QRect(l2,0,60,800);
    QRect r3=QRect(l3,0,60,800);
    QRect r4=QRect(l4,0,60,800);

    int ran1[4];
    int ran2[4];

    void setl();






public slots:
    void slotStart();

private:
    Ui::flappybird *ui;
};


#endif // FLAPPYBIRD_H
